package com.jas.storage;

import java.util.ArrayList;

import com.jas.common.Action;


//@author A0121310J
public class ActionList {
	private static ArrayList<Action> actionList;
	
	//constuctors
	public ActionList(){
		actionList = new ArrayList<Action>();
	}
	public ActionList(ArrayList<Action> actionList){
		this.actionList = actionList;
	}
	
	
	//public methods can be used
	public void addAction(Action action){
		actionList.add(action);
	}
	public void deleteAction(int index){
		actionList.remove(index);
	}
	public void deleteLastAction(){
		deleteAction(actionList.size()-1);
	}
	public Action getLastAction(){
		return getActionListElement(actionList.size()-1);
	}
	
	
	//getter setter methods
	public ArrayList<Action> getActionList(){
		return actionList;
	}
	public static void setActionList(ArrayList<Action> al){
		actionList = al;
	}
	public Action getActionListElement(int index){
		return actionList.get(index);
	}
}
